/// 安全Await
Future<T?> safeAwait<T>(Future<T> future, {T? defaultValue, void Function(Object, StackTrace)? onError}) async {
  try {
    return await future;
  } catch (e, stackTrace) {
    onError?.call(e, stackTrace);
    return defaultValue;
  }
}
